#include <bits/stdc++.h>
// 2025/02/06
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int s, n, m, w[101][101], v[101][101], dp[20001];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> s >> n >> m;
    for (int i = 1; i <= s; i++)
        for (int j = 1; j <= n; j++)
            cin >> w[j][i];
    for (int i = 1; i <= n; i++)
        sort(w[i] + 1, w[i] + s + 1);
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= s; j++)
            w[i][j] = w[i][j] * 2 + 1;
    for (int k = 1; k <= n; k++)
        for (int i = m; i >= 0; i--)
            for (int j = 1; j <= s; j++)
                if (i >= w[k][j])
                    dp[i] = max(dp[i], dp[i - w[k][j]] + k * j);
    cout << dp[m];
    return 0;
}